import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'
import { DetailInfo } from '~/services/types'

@Module({
  name: 'root',
  stateFactory: true,
  namespaced: true
})
export default class MyModule extends VuexModule {
  detailInfos: DetailInfo[] = [];

  @Mutation
  updateDetailInfoState (detailInfos: DetailInfo[]) {
    this.detailInfos = detailInfos
  }

  @Action
  changeDetailInfoAction (detailInfos: DetailInfo[]) {
    this.updateDetailInfoState(detailInfos)
  }
}
